package cn.iocoder.yudao.framework.business.basic.pojo.bo;

import cn.hutool.core.collection.CollUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * 模板参数
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2024/12/05
 */
@Data
@NoArgsConstructor
public class TemplateParameter implements Serializable {

    @Schema(description = "模板参数值，单选或多选值时用英文逗号分隔", requiredMode = Schema.RequiredMode.REQUIRED, example = "免预约")
    private String value;

    @Schema(description = "模板参数排序", example = "0")
    private Integer sort;

    public static List<String> formatValues(List<TemplateParameter> list) {
        List<String> result = new ArrayList<>();
        if (CollUtil.isEmpty(list)) {
            return result;
        }
        for (TemplateParameter param : list) {
            result.add(param.getValue());
        }
        return result;
    }

}
